package homework.test1

import scala.io.StdIn

object CountOccurrences {


  def main(args: Array[String]): Unit = {
    val list = List(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 3, 4, 5)
    var count =0
    println("请输入一个数字")
    val num = StdIn.readInt()
    for(i<-0 to (list.length-1)){

      if(num == list(i)){
        count +=1
      }
    }
    println(s"${num}出现了${count}次")
  }

}
